package judesart.app.domain;

import java.io.Serializable;
import java.util.List;

import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;

@Entity
@NamedQueries( { @NamedQuery(name = "Artist.findByUserId", query = "select o from Artist o where o.userId = :userId") })
public class Artist implements Serializable
{

    private static final long serialVersionUID = 1L;

    @ManyToOne(cascade = CascadeType.ALL)
    private Address address;

    @Basic
    private String facebookUser;

    @Basic
    private String flickrUser;

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

    @Basic
    private String phone;

    @ManyToOne(cascade = CascadeType.ALL)
    private Profile profile;

    @Basic
    private Long userId;

    @OneToMany(cascade = CascadeType.ALL, mappedBy = "artist")
    private List<ArtistPhoto> photos;

    public void setPhotos(List<ArtistPhoto> photos)
    {
        this.photos = photos;
    }

    public List<ArtistPhoto> getPhotos()
    {
        return photos;
    }

    public Artist()
    {
        super();
    }

    public Address getAddress()
    {
        return address;
    }

    public String getFacebookUser()
    {
        return facebookUser;
    }

    public String getFlickrUser()
    {
        return flickrUser;
    }

    public Long getId()
    {
        return id;
    }

    public String getPhone()
    {
        return phone;
    }

    public Profile getProfile()
    {
        return profile;
    }

    public Long getUserId()
    {
        return userId;
    }

    public void setAddress(Address address)
    {
        this.address = address;
    }

    public void setFacebookUser(String facebookUser)
    {
        this.facebookUser = facebookUser;
    }

    public void setFlickrUser(String flickrUser)
    {
        this.flickrUser = flickrUser;
    }

    public void setId(Long id)
    {
        this.id = id;
    }

    public void setPhone(String phone)
    {
        this.phone = phone;
    }

    public void setProfile(Profile profile)
    {
        this.profile = profile;
    }

    public void setUserId(Long userId)
    {
        this.userId = userId;
    }
}
